gtk4.git
5 years agogdk: Small documentation fixes
Matthias Clasen [Sun, 28 Jun 2020 16:23:08 +0000 (12:23 -0400)]
gdk: Small documentation fixes

Make sure gdk_event_get_seat shows up.

5 years agostack: Cosmetic documentation fixes
Matthias Clasen [Sun, 28 Jun 2020 12:06:17 +0000 (08:06 -0400)]
stack: Cosmetic documentation fixes

Fix parameter mismatches.

5 years agobitset: Cosmetic documentation changes
Matthias Clasen [Sun, 28 Jun 2020 01:53:57 +0000 (21:53 -0400)]
bitset: Cosmetic documentation changes

5 years agodocs: Remove ancient version information
Matthias Clasen [Sun, 28 Jun 2020 01:46:22 +0000 (21:46 -0400)]
docs: Remove ancient version information

We treat 4.0 as a new era.

5 years agomultiselection: Update docs
Matthias Clasen [Sun, 28 Jun 2020 01:37:28 +0000 (21:37 -0400)]
multiselection: Update docs

Remove information that is no longer true. GtkMultiSelection
is persistent across sorting changes since 3d8b6f6b799499cca02.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sat, 27 Jun 2020 22:19:27 +0000 (22:19 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2160

5 years agodocs: Migration guide additions
Matthias Clasen [Sat, 27 Jun 2020 21:31:22 +0000 (17:31 -0400)]
docs: Migration guide additions

5 years agobuilder: Documentation tweaks
Matthias Clasen [Sat, 27 Jun 2020 21:28:15 +0000 (17:28 -0400)]
builder: Documentation tweaks

Don't use no-longer-existing enums as examples,
and drop the +.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sat, 27 Jun 2020 19:43:18 +0000 (19:43 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2159

5 years agoUpdate Kazakh translation
Baurzhan Muftakhidinov [Sat, 27 Jun 2020 19:11:12 +0000 (19:11 +0000)]
Update Kazakh translation

5 years agoUpdate Kazakh translation
Baurzhan Muftakhidinov [Sat, 27 Jun 2020 18:52:16 +0000 (18:52 +0000)]
Update Kazakh translation

5 years agogtk-demo: Drop an unused object
Matthias Clasen [Sat, 27 Jun 2020 13:47:29 +0000 (09:47 -0400)]
gtk-demo: Drop an unused object

The main ui file was still creating a tree store,
but we've switched everything over to use list models.

5 years agobuilder: Warn about dropped objects
Matthias Clasen [Sat, 27 Jun 2020 13:36:45 +0000 (09:36 -0400)]
builder: Warn about dropped objects

Use GTK_DEBUG=builder-objects to make GtkBuilder warn
if a named object from a ui files doesn't get claimed
by gtk_builder_get_object(). This is useful for finding
dead wood in .ui files.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sat, 27 Jun 2020 03:51:21 +0000 (03:51 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

Closes #2897 and #2898

See merge request GNOME/gtk!2158

5 years agolistitem: Correct the docs
Matthias Clasen [Sat, 27 Jun 2020 03:07:28 +0000 (23:07 -0400)]
listitem: Correct the docs

5 years agogtk-demo: Improve formatting in the color demo
Matthias Clasen [Sat, 27 Jun 2020 02:57:56 +0000 (22:57 -0400)]
gtk-demo: Improve formatting in the color demo

Properly align and format the numbers in the size
dropdown.

5 years agotext: Support reverse selection
Matthias Clasen [Sat, 27 Jun 2020 02:22:47 +0000 (22:22 -0400)]
text: Support reverse selection

Take ordering of cursor_position and selection_bound
into account when copying text to the clipboard, and
ensure that both orders work the same.

Fixes: #2898
5 years agotext: Update action enabled state correctly
Matthias Clasen [Sat, 27 Jun 2020 02:13:12 +0000 (22:13 -0400)]
text: Update action enabled state correctly

Take the editable property into account when updating
the emoji.insert action state, and update the action
when it changes.

Fixes: #2897
5 years agoshortcutcontroller: Add some debug spew
Matthias Clasen [Sat, 27 Jun 2020 02:12:42 +0000 (22:12 -0400)]
shortcutcontroller: Add some debug spew

This helps in debugging event routing and keyboard
shortcut issues.

5 years agowidget: Fix an oversight
Matthias Clasen [Sat, 27 Jun 2020 02:12:14 +0000 (22:12 -0400)]
widget: Fix an oversight

g_message comes with a builtin newline, don't add one
to the message.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Sat, 27 Jun 2020 00:35:51 +0000 (00:35 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Adwaita: Fix block cursors in spinbuttons

Closes #2871

See merge request GNOME/gtk!2156

5 years agoAdwaita: Fix block cursors in spinbuttons
Matthias Clasen [Fri, 26 Jun 2020 23:55:19 +0000 (19:55 -0400)]
Adwaita: Fix block cursors in spinbuttons

Fix block cursors in vertical spinbuttons with Adwaita.

Fixes: #2871
5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Fri, 26 Jun 2020 21:14:27 +0000 (21:14 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

Closes #2869

See merge request GNOME/gtk!2155

5 years agodocs: Add css docs to entries
Matthias Clasen [Fri, 26 Jun 2020 15:56:27 +0000 (11:56 -0400)]
docs: Add css docs to entries

The various entries were missing the semi-standard
"CSS Nodes" section in their long descriptions. Add
them.

5 years agotext: Be more selective when selecting on focus-in
Matthias Clasen [Fri, 26 Jun 2020 19:49:39 +0000 (15:49 -0400)]
text: Be more selective when selecting on focus-in

We don't want to select on focus-in when the focus
comes from a child. The case where this does harm
is when you activate copy or paste actions from the
context menu. We close the menu before triggering the
action, and if that causes the text in the entry to
be selected, unexpected things happen, since the action
applies to the current selection.

Fixes: #2869
5 years agoRevert "text: Avoid creating a PangoAttrList we don't need"
Matthias Clasen [Fri, 26 Jun 2020 19:27:09 +0000 (15:27 -0400)]
Revert "text: Avoid creating a PangoAttrList we don't need"

This reverts commit 67c26650280ba64ff1c0318be8d848e9563ddb21.

The splicing we do here has the important side-effect
of shifting the preedit attributes to the right position.
Without it, we end up always underlining the first chars
in the entry, regardless where the preedit happens.

5 years agotext: Handle key events in the target phase
Matthias Clasen [Fri, 26 Jun 2020 18:08:35 +0000 (14:08 -0400)]
text: Handle key events in the target phase

This makes sure that we do actual key input right
in the middle between all the capture and bubble
event controllers, and are not dependent on the
ordering of those controllers.

The bug that triggered this change was that the
shortcut for activation (Enter) was getting triggered
before the key input, causing Ctrl-Shift-u hex
to stop working, since it never received the enter
to commit the sequence.

5 years agowidget: Add a debug message for consumed key events
Matthias Clasen [Fri, 26 Jun 2020 18:05:57 +0000 (14:05 -0400)]
widget: Add a debug message for consumed key events

Run the application with GTK_DEBUG=keybindings to
get some hints where key events get lost.

5 years agotext: Give names to event controllers
Matthias Clasen [Fri, 26 Jun 2020 18:05:28 +0000 (14:05 -0400)]
text: Give names to event controllers

It helps with debugging.

5 years agoMerge branch 'wip/carlosg/sequence-state-fixups' into 'master'
Matthias Clasen [Fri, 26 Jun 2020 17:08:09 +0000 (17:08 +0000)]
Merge branch 'wip/carlosg/sequence-state-fixups' into 'master'

Fixups to gesture sequence states

Closes #2895

See merge request GNOME/gtk!2154

5 years agogtktext: Don't accept (twice!) all press actions
Carlos Garnacho [Fri, 26 Jun 2020 15:36:37 +0000 (17:36 +0200)]
gtktext: Don't accept (twice!) all press actions

The gesture should claim the sequence after triggering uncancellable
actions, like pasting, showing a menu or selecting words/lines. A
single first button press initiating a drag does not trigger
anything yet, so it should avoid claiming the sequence.

5 years agogtkswitch: Don't be eager in accepting the gesture
Carlos Garnacho [Fri, 26 Jun 2020 15:35:05 +0000 (17:35 +0200)]
gtkswitch: Don't be eager in accepting the gesture

The gesture should be accepted whenever it triggers uncancellable
actions in the widget. This means it should be accepted if the
click does result in toggling the switch.

This leaves the pan gesture room to handle dragging the handle.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2895
5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Fri, 26 Jun 2020 14:31:20 +0000 (14:31 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

main: Avoid a warning

Closes #2894

See merge request GNOME/gtk!2153

5 years agodocs: Some tweaks to the list widget overview
Matthias Clasen [Fri, 26 Jun 2020 13:05:56 +0000 (09:05 -0400)]
docs: Some tweaks to the list widget overview

5 years agoMerge branch 'wip/otte/bitset' into 'master'
Matthias Clasen [Fri, 26 Jun 2020 12:43:49 +0000 (12:43 +0000)]
Merge branch 'wip/otte/bitset' into 'master'

Improve selection handling API for rubberbanding

See merge request GNOME/gtk!2086

5 years agomain: Avoid a warning
Matthias Clasen [Fri, 26 Jun 2020 12:19:32 +0000 (08:19 -0400)]
main: Avoid a warning

transient-for relationships only exist between
windows, so check that both candidates are such.

Fixes: #2894
5 years agoMerge branch 'tintou/dropdown-annotations' into 'master'
Emmanuele Bassi [Fri, 26 Jun 2020 08:48:51 +0000 (08:48 +0000)]
Merge branch 'tintou/dropdown-annotations' into 'master'

dropdown: Annotate the get_selected_item method

See merge request GNOME/gtk!2152

5 years agoMerge branch 'wip/ricotz/annotations' into 'master'
Emmanuele Bassi [Fri, 26 Jun 2020 08:46:35 +0000 (08:46 +0000)]
Merge branch 'wip/ricotz/annotations' into 'master'

gtk: Add some g-i annotations to GtkStringList

See merge request GNOME/gtk!2150

5 years agodropdown: Annotate the get_selected_item method
Corentin Noël [Fri, 26 Jun 2020 07:59:12 +0000 (09:59 +0200)]
dropdown: Annotate the get_selected_item method

We need to specify the type as we already know that it is at least a GObject and in case of no selection, NULL is returned.

5 years agolistbase: Make rubberbanding a threshold drag
Benjamin Otte [Fri, 26 Jun 2020 02:07:35 +0000 (04:07 +0200)]
listbase: Make rubberbanding a threshold drag

5 years agolistbase: Only compute the modifiers when releasing the rubberband
Benjamin Otte [Fri, 26 Jun 2020 01:26:11 +0000 (03:26 +0200)]
listbase: Only compute the modifiers when releasing the rubberband

... and do the right things:

nothing:    selection = rubberband
ctrl:       selection = selection OR rubberband
shift:      selection = selection AND (NOT rubberband)
ctrl+shift: selection = selection XOR rubberband
            (not sure this one makes sense, but toggling is fun)

5 years agolistbase: Compute rubberband region on-demand
Benjamin Otte [Fri, 26 Jun 2020 00:56:38 +0000 (02:56 +0200)]
listbase: Compute rubberband region on-demand

Instead of storing the active items as we go, compute the affected items
whenever the rubberband changes and in particular when the rubberband
ends.
That way, the rubberband is guaranteed to select a rectangle even
after scrolling very far.

This is achieved by having a get_items_in_rect() vfunc that selects all
the items in the rubberbanded rectangle and returns them as a bitset.

5 years agolistview: Allocate rubberband at end of size_allocate()
Benjamin Otte [Fri, 26 Jun 2020 00:55:53 +0000 (02:55 +0200)]
listview: Allocate rubberband at end of size_allocate()

Otherwise the rubberband uses the wrong scroll offsets.

5 years agolistbase: Flip autoscroll deltas if adjustments are flipped
Benjamin Otte [Wed, 24 Jun 2020 03:52:35 +0000 (05:52 +0200)]
listbase: Flip autoscroll deltas if adjustments are flipped

Fixes autoscroll on RTL languages.

5 years agolistbase: Allocate gridview items properly on RTL
Benjamin Otte [Wed, 24 Jun 2020 03:42:38 +0000 (05:42 +0200)]
listbase: Allocate gridview items properly on RTL

We need to flip the items.

5 years agomultiselection: Implement get_selection_in_range()
Benjamin Otte [Wed, 24 Jun 2020 03:25:28 +0000 (05:25 +0200)]
multiselection: Implement get_selection_in_range()

5 years agolistbase: Allocate rubberband according to list coords
Benjamin Otte [Wed, 24 Jun 2020 03:02:04 +0000 (05:02 +0200)]
listbase: Allocate rubberband according to list coords

The rubberband is now handled on the list coordinate system.

When starting the rubberband, we track the item under the pointer and
follow it when it is moving.
This may lead to the rubberband start position changing position and
while this may be confusing, it alerts users to the fact that something
crazy is going on.

5 years agolistbase: Move a common function from the children into GtkListBase
Benjamin Otte [Wed, 24 Jun 2020 02:49:21 +0000 (04:49 +0200)]
listbase: Move a common function from the children into GtkListBase

We want to use it for the rubberband later.

5 years agolistbase: Don't do extra work
Benjamin Otte [Wed, 24 Jun 2020 02:46:53 +0000 (04:46 +0200)]
listbase: Don't do extra work

Scrolling causes a queue_resize() which will update the rubberband in
size_allocate() and queue a draw.

5 years agoFix indentation
Benjamin Otte [Sun, 21 Jun 2020 21:01:36 +0000 (23:01 +0200)]
Fix indentation

5 years agogtk: Remove GtkPropertySelection
Benjamin Otte [Sun, 21 Jun 2020 16:03:25 +0000 (18:03 +0200)]
gtk: Remove GtkPropertySelection

GtkMultiSelection is so much faster than this that it isn't needed.

5 years agogtk-demo: Port listview-colors demo to multiselection again
Benjamin Otte [Sun, 21 Jun 2020 16:00:11 +0000 (18:00 +0200)]
gtk-demo: Port listview-colors demo to multiselection again

5 years agomultiselection: Track items across resorts
Benjamin Otte [Sun, 21 Jun 2020 15:58:27 +0000 (17:58 +0200)]
multiselection: Track items across resorts

In particular, track which items remain in ::items-changed
signal emissions.

But the main use case is sorting, which causes items-changed(0, n, n)
to be emitted.

5 years agoRemove GtkSet
Benjamin Otte [Sun, 14 Jun 2020 05:08:44 +0000 (07:08 +0200)]
Remove GtkSet

It's been superceded by GtkBitset.

5 years agoselectionmodel: Remove select_callback() functions
Benjamin Otte [Sun, 14 Jun 2020 05:07:30 +0000 (07:07 +0200)]
selectionmodel: Remove select_callback() functions

gtk_selection_model_set_selection() takes care of those now.

5 years agolistbase: Port rubberband to gtk_selection_model_set_selection()
Benjamin Otte [Sun, 14 Jun 2020 04:50:22 +0000 (06:50 +0200)]
listbase: Port rubberband to gtk_selection_model_set_selection()

5 years agoselectionmodel: Add gtk_selection_model_set_selection()
Benjamin Otte [Sun, 14 Jun 2020 04:41:05 +0000 (06:41 +0200)]
selectionmodel: Add gtk_selection_model_set_selection()

Also port the testsuite.

5 years agoselectionmodel: Replace query_range() with get_selection()
Benjamin Otte [Sun, 14 Jun 2020 03:30:06 +0000 (05:30 +0200)]
selectionmodel: Replace query_range() with get_selection()

5 years agomultiselection: Port to GtkBitset
Benjamin Otte [Sat, 13 Jun 2020 03:27:34 +0000 (05:27 +0200)]
multiselection: Port to GtkBitset

5 years agotestsuite: Add tests for GtkBitset
Benjamin Otte [Sat, 13 Jun 2020 03:05:30 +0000 (05:05 +0200)]
testsuite: Add tests for GtkBitset

5 years agoAdd GtkBitset
Benjamin Otte [Wed, 10 Jun 2020 06:14:02 +0000 (08:14 +0200)]
Add GtkBitset

5 years agogtk: Add some g-i annotations to GtkStringList
Rico Tzschichholz [Thu, 25 Jun 2020 21:10:37 +0000 (23:10 +0200)]
gtk: Add some g-i annotations to GtkStringList

5 years agoAdd amalgamated roaring bitmaps source code
Benjamin Otte [Wed, 10 Jun 2020 05:39:25 +0000 (07:39 +0200)]
Add amalgamated roaring bitmaps source code

Taken from https://github.com/RoaringBitmap/CRoaring and fixed to
not spew warnings.

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Thu, 25 Jun 2020 22:28:07 +0000 (22:28 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2149

5 years agoinspector: Adapt to dropdown api change
Matthias Clasen [Thu, 25 Jun 2020 20:40:54 +0000 (16:40 -0400)]
inspector: Adapt to dropdown api change

The suppported syntax for dropdowns in ui files
has changed. Get with the program.

5 years agodocs: Fix a typo
Matthias Clasen [Thu, 25 Jun 2020 18:29:24 +0000 (14:29 -0400)]
docs: Fix a typo

5 years agogtk-demo: Fix a typo in the listbox demo
Matthias Clasen [Thu, 25 Jun 2020 18:28:29 +0000 (14:28 -0400)]
gtk-demo: Fix a typo in the listbox demo

5 years agosearchentry: Update the docs slightly
Matthias Clasen [Thu, 25 Jun 2020 18:14:33 +0000 (14:14 -0400)]
searchentry: Update the docs slightly

Update the docs to get closer to describing reality.

5 years agoDrop unused includes
Matthias Clasen [Thu, 25 Jun 2020 12:03:10 +0000 (08:03 -0400)]
Drop unused includes

Don't include gtkfilechooserentry.h where it
isn't used.

5 years agostringfilter: Fix a typo
Matthias Clasen [Thu, 25 Jun 2020 02:08:09 +0000 (22:08 -0400)]
stringfilter: Fix a typo

5 years agoUpdate Turkish translation
Emin Tufan Çetin [Thu, 25 Jun 2020 01:05:12 +0000 (01:05 +0000)]
Update Turkish translation

5 years agoMerge branch 'wip/carlosg/input-cleanups' into 'master'
Matthias Clasen [Wed, 24 Jun 2020 21:32:30 +0000 (21:32 +0000)]
Merge branch 'wip/carlosg/input-cleanups' into 'master'

Some input cleanups

Closes #2851

See merge request GNOME/gtk!2147

5 years agoMerge branch 'scrolled-window-api' into 'master'
Matthias Clasen [Wed, 24 Jun 2020 19:58:03 +0000 (19:58 +0000)]
Merge branch 'scrolled-window-api' into 'master'

scrolledwindow: Don't take adjustments in new()

See merge request GNOME/gtk!2146

5 years agoMerge branch 'matthiasc/for-master' into 'master'
Matthias Clasen [Wed, 24 Jun 2020 19:50:37 +0000 (19:50 +0000)]
Merge branch 'matthiasc/for-master' into 'master'

Matthiasc/for master

See merge request GNOME/gtk!2145

5 years agogtktextview: Remove child textview items last
Carlos Garnacho [Wed, 24 Jun 2020 18:19:03 +0000 (20:19 +0200)]
gtktextview: Remove child textview items last

The function tries to go through every child, so it's convenient
to remove all internal ones first.

5 years agogtkwidget: Drop _gtk_widget_[gs]et_shadowed()
Carlos Garnacho [Wed, 24 Jun 2020 15:31:03 +0000 (17:31 +0200)]
gtkwidget: Drop _gtk_widget_[gs]et_shadowed()

This API is meaningless now, with grab-notify being handled internally.

5 years agogtkwidget: Avoid use of shadowed flag
Carlos Garnacho [Wed, 24 Jun 2020 16:24:12 +0000 (18:24 +0200)]
gtkwidget: Avoid use of shadowed flag

This is going away, look up whether there is a grab, and whether
the widget is within it, instead.

5 years agogtkwidget: Drop gtk_widget_device_is_shadowed()
Carlos Garnacho [Wed, 24 Jun 2020 15:25:34 +0000 (17:25 +0200)]
gtkwidget: Drop gtk_widget_device_is_shadowed()

A widget no longer needs updating on GTK grabs on itself, drop
this miscellaneous and no longer used API.

5 years agogtkwidget: Drop internal checks in grab-notify
Carlos Garnacho [Wed, 24 Jun 2020 15:23:11 +0000 (17:23 +0200)]
gtkwidget: Drop internal checks in grab-notify

There's no need to check if the widget is already shadowed, we
implicitly have that from the signal argument.

5 years agogtkmain: Make grab-notify notifications more targeted
Carlos Garnacho [Wed, 24 Jun 2020 15:19:57 +0000 (17:19 +0200)]
gtkmain: Make grab-notify notifications more targeted

We only want to send grab-notify to widgets that might have been
interacting with devices via events. Instead of going through all
widgets in all toplevels, we have the window/pointer focus information,
so we can just traverse the widget stacks for every involved foci.

5 years agogtkwidget: Drop ::grab-notify signal and vfunc
Carlos Garnacho [Wed, 24 Jun 2020 13:40:05 +0000 (15:40 +0200)]
gtkwidget: Drop ::grab-notify signal and vfunc

We don't expect widgets to react directly to these anymore.
Internally we still reset the controllers.

5 years agogtkprintoperation-win32: Don't track grab-notify
Carlos Garnacho [Wed, 24 Jun 2020 13:37:11 +0000 (15:37 +0200)]
gtkprintoperation-win32: Don't track grab-notify

Further grabs could presumably only come from events handled within
the dialog itself. It seems overeager to do this.

5 years agogtkvideo: Track child focus to determine whether controls should autohide
Carlos Garnacho [Wed, 24 Jun 2020 13:35:16 +0000 (15:35 +0200)]
gtkvideo: Track child focus to determine whether controls should autohide

Move away from grab_notify, and use the set_child_focus() vfunc to track
child widgets being set the keyboard focus. This is not 1:1, but seems
good enough at the moment.

5 years agogtkbutton: Drop grab_notify handler
Carlos Garnacho [Wed, 24 Jun 2020 12:17:15 +0000 (14:17 +0200)]
gtkbutton: Drop grab_notify handler

The click gesture already has a ::cancel handler, and does almost
everything it should. Move the last bits and remove the grab_notify
handler.

5 years agogtkspinbutton: Drop grab_notify handler
Carlos Garnacho [Wed, 24 Jun 2020 12:12:01 +0000 (14:12 +0200)]
gtkspinbutton: Drop grab_notify handler

The press gesture on the buttons already has a ::cancel handler,
this is redundant.

5 years agogtknotebook: Move away from grab_notify
Carlos Garnacho [Wed, 24 Jun 2020 12:10:42 +0000 (14:10 +0200)]
gtknotebook: Move away from grab_notify

Connect to ::cancel on the relevant gesture instead.

5 years agotestgtk: Update list of cursor names
Matthias Clasen [Wed, 24 Jun 2020 18:06:50 +0000 (14:06 -0400)]
testgtk: Update list of cursor names

Use the standard names, since that is what we want
everybody else to use too.

5 years agoInstall gtkstringlist.h
Matthias Clasen [Wed, 24 Jun 2020 17:01:34 +0000 (13:01 -0400)]
Install gtkstringlist.h

5 years agoentrycompletion: Various fixes
Matthias Clasen [Wed, 24 Jun 2020 04:26:27 +0000 (00:26 -0400)]
entrycompletion: Various fixes

Fix various issues that prevented inline completion
and inline selection from working reliably. We were
passing byte counts to gtk_editable_select_region in
one place, but that function expects char counts.
We were listening for GtkEditable::insert-text on
the GtkText widget, but that does not emit those signals,
so listen for GtkEntryBuffer::inserted-text instead.
Finally, we were not clearing the stored completion_prefix
enough, leading to situations where the stored prefix
does not match the text in the entry anymore.

5 years agogtk-demo: Enable inline completion
Matthias Clasen [Wed, 24 Jun 2020 04:27:21 +0000 (00:27 -0400)]
gtk-demo: Enable inline completion

Enable inline completion in the entry completion
demo, to have some code exercising this feature.
It is broken.

5 years agogtk-demo: Improve the entry completion demo
Matthias Clasen [Wed, 24 Jun 2020 02:39:16 +0000 (22:39 -0400)]
gtk-demo: Improve the entry completion demo

Add more strings.

5 years agoscrolledwindow: Don't take adjustments in new()
Matthias Clasen [Wed, 24 Jun 2020 15:25:09 +0000 (11:25 -0400)]
scrolledwindow: Don't take adjustments in new()

In 99.9% of all cases, these are just NULL, NULL.
So just do away with these arguments, people can
use the setters for the rare cases where they want
the scrolled window to use a different adjustment.

5 years agogtkwindowhandle: Drop has-grab checks
Carlos Garnacho [Wed, 24 Jun 2020 11:41:28 +0000 (13:41 +0200)]
gtkwindowhandle: Drop has-grab checks

While it's worth thinking about bringing the "windows can be dragged
with open popovers" behavior back, this does not kick in anymore, nor
should be the way to handle this given all the autoclose surface
semantic changes.

5 years agogdk: Drop gdk_device_get_last_event_surface()
Carlos Garnacho [Wed, 24 Jun 2020 09:20:15 +0000 (11:20 +0200)]
gdk: Drop gdk_device_get_last_event_surface()

This kind of transient state sets the expectative that events update
devices, while it's more accurate to say that devices generate events.
It does not make to expose this function anymore.

5 years agogtkwidget: Avoid poking surfaces and events in gtk_widget_list_devices()
Carlos Garnacho [Wed, 24 Jun 2020 09:14:52 +0000 (11:14 +0200)]
gtkwidget: Avoid poking surfaces and events in gtk_widget_list_devices()

This got stuck in ancient times when widgets were windowed, so the devices
in a window to know the devices in that widget would pan out. We do only
want here the devices that are inside the widget, not spread over the
surface, so rewrite this helper function to poke the toplevel foci, and
look they are contained inside the widget.

5 years agogtkwidget: Drop _gtk_widget_get_device_surface()
Carlos Garnacho [Tue, 23 Jun 2020 10:19:20 +0000 (12:19 +0200)]
gtkwidget: Drop _gtk_widget_get_device_surface()

A widget cannot have multiple surfaces anymore, nor needs to
fetch the last event surface as it ought to handle its own.

5 years agogtkmain: Drop unused struct field
Carlos Garnacho [Tue, 23 Jun 2020 10:15:00 +0000 (12:15 +0200)]
gtkmain: Drop unused struct field

Grabs are, ironically, not about devices anymore. This struct field
is never set.

5 years agogtkwidget: Remove dead code
Carlos Garnacho [Tue, 23 Jun 2020 09:15:04 +0000 (11:15 +0200)]
gtkwidget: Remove dead code

This variable got unused over time.

5 years agogdk: Depend less on gdk_event_get_device()
Carlos Garnacho [Tue, 23 Jun 2020 09:00:46 +0000 (11:00 +0200)]
gdk: Depend less on gdk_event_get_device()

For the most part, we are interested in seats here.

5 years agogdk: Add gdk_event_get_seat()
Carlos Garnacho [Mon, 22 Jun 2020 23:14:53 +0000 (01:14 +0200)]
gdk: Add gdk_event_get_seat()

It currently fetches the seat from the event device, will be changed
in future commits.